package com.matrix.api.review.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

/**
 * @author 有点甜
 * @since 2025/7/27
 */
@Data
public class ReviewDTO {
    @NotNull(message = "订单ID不能为空")
    private Long orderId;

    @NotNull(message = "店铺总评分不能为空")
    @Min(1) @Max(5)
    private Integer overallRating;

    @NotNull(message = "口味评分不能为空")
    @Min(1) @Max(5)
    private Integer tasteRating;

    @NotNull(message = "包装评分不能为空")
    @Min(1) @Max(5)
    private Integer packagingRating;

    private Boolean anonymous = false;

    @NotEmpty(message = "至少需要评价一个菜品")
    @Valid
    private List<ReviewItemDTO> reviewItems;
}
